
package dieci.hibernate;

import dieci.database.PersistentObject;
import java.util.Date;

/**
 *
 * @author DuckSys
 */
public class HibPriceId implements PersistentObject{

    private Long productId;
    private Date priceDate;

    public HibPriceId()
    {
    }

    public HibPriceId(Long productId, Date priceDate)
    {
        this.productId = productId;
        this.priceDate = priceDate;
    }
        
    
    /**
     * Get the value of productId
     *
     * @return the value of productId
     */
    public Long getProductId()
    {
        return productId;
    }

    /**
     * Set the value of productId
     *
     * @param productId new value of productId
     */
    public void setProductId(Long productId)
    {
        this.productId = productId;
    }
    

    /**
     * Get the value of priceDate
     *
     * @return the value of priceDate
     */
    public Date getPriceDate()
    {
        return priceDate;
    }

    /**
     * Set the value of priceDate
     *
     * @param priceDate new value of priceDate
     */
    public void setPriceDate(Date priceDate)
    {
        this.priceDate = priceDate;
    }
    
    @Override
    public boolean equals (Object obj)
    {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (!(obj instanceof HibPriceId))
            return false;
        final HibPriceId other = (HibPriceId) obj;
        if (!this.getProductId().equals(other.getProductId()))
            return false;
        if (!this.getPriceDate().equals(other.getPriceDate()))
            return false;
        return true;
    }

    @Override
    public int hashCode ()
    {
        int hash = 7;
        hash = 61 * hash + (int) (this.getProductId() ^ (this.getProductId() >>> 32));
        hash = 61 * hash + (int) (this.getPriceDate().hashCode() ^ (this.getPriceDate().hashCode() >>> 31));
        return hash;
    }

}
